package lion.dev.matcher;

import org.apache.commons.lang.StringUtils;

/**
 * 包含匹配
 *
 * @author lion
 * @email hl_0074@sina.com
 * @date 2014年5月8日
 */
public class IncluceMatcher implements Matcher {

	private String name;

	public IncluceMatcher(String name) {

		this.name = name;
	}

	@Override
	public boolean match(String fileName) {

		if (StringUtils.isBlank(name)) { return false; }

		return fileName.indexOf(this.name) > -1;
	}

	@Override
	public boolean equals(String name) {

		return StringUtils.equals(this.name, name);
	}

}
